package com.itheima.controller;

import com.itheima.service.ServiceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//被扫描
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private ServiceDao serviceDao;

    //配置路径
    //访问方法
    @ResponseBody        //把返回的数据当做数据处理，不会再去找页面
    @RequestMapping("/save")
    public String save(){
        serviceDao.one();
        System.out.println("save ...");
        return "{'info' : 'hellow'}";
    }
}
